
"ui";
var storage = storages.create("meipai");


var my_time1 = storage.get('my_time1');
if (my_time1 == undefined) {
    my_time1 = '5'
}

var my_time2 = storage.get('my_time2');
if (my_time2 == undefined) {
    my_time2 = '5'
}

var my_time3 = storage.get('my_time3');
if (my_time3 == undefined) {
    my_time3 = '5'
}

var my_time4 = storage.get('my_time4');
if (my_time4 == undefined) {
    my_time4 = '5'
}

var my_time5 = storage.get('my_time5');
if (my_time5 == undefined) {
    my_time5 = '5'
}

var my_time6 = storage.get('my_time6');
if (my_time6 == undefined) {
    my_time6 = '5'
}

var my_time7 = storage.get('my_time7');
if (my_time7 == undefined) {
    my_time7 = '5'
}

var my_content = storage.get('my_content');
if (my_content == undefined) {
    my_content = '话术a|话术b|话术c|话术d'
}

// 打码账号
var tp_user = storage.get('tp_user');
if (tp_user == undefined) {
    tp_user = '请输入打码账号'
}
// 打码密码
var tp_pwd = storage.get('tp_pwd');

if (tp_pwd == undefined) {
    tp_pwd = '请输入打码密码'
}
// 打码id
var softid = storage.get('softid');
if (softid == undefined) {
    softid = '请输入打码id'
}


xml ='<vertical padding="16">\
        <button id="ok" text="开始"/>\
        <text text="音量上键停止运行" textSize="40sp"  gravity="center"/>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="打码账号"/>\
        <input id="tp_user" text="' + tp_user + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="打码密码"/>\
        <input id="tp_pwd" text="' + tp_pwd + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="打码id"/>\
        <input id="softid" text="' + softid + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="用户点击间隔/秒"/>\
        <input id="my_time1" inputType="number" text="' + my_time1 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="点击私信间隔/秒"/>\
        <input id="my_time2" inputType="number" text="' + my_time2 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="输入话术间隔/秒"/>\
        <input id="my_time3" inputType="number" text="' + my_time3 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="点击发送间隔/秒"/>\
        <input id="my_time4" inputType="number" text="' + my_time4 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="返回到用户主页间隔/秒"/>\
        <input id="my_time5" inputType="number" text="' + my_time5 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="返回到粉丝列表间隔/秒"/>\
        <input id="my_time6" inputType="number" text="' + my_time6 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="粉丝列表停留间隔/秒"/>\
        <input id="my_time7" inputType="number" text="' + my_time7 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="私信话术"/>\
        <input id="my_content" text="' + my_content + '"/>\
        </horizontal>\
    </vertical>'

ui.layout(
    xml
);

//指定确定按钮点击时要执行的动作
ui.ok.click(function(){
    //通过getText()获取输入的内容
    toast("开始辣");
    var my_content = ui.my_content.text();
    var my_time1 = ui.my_time1.text();
    var my_time2 = ui.my_time2.text();
    var my_time3 = ui.my_time3.text();
    var my_time4 = ui.my_time4.text();
    var my_time5 = ui.my_time5.text();
    var my_time6 = ui.my_time6.text();
    var my_time7 = ui.my_time7.text();
    var tp_user = ui.tp_user.text();
    var tp_pwd = ui.tp_pwd.text();
    var softid = ui.softid.text();
    

    storage.put("my_content", my_content);
    storage.put("my_time1", parseInt(my_time1));
    storage.put("my_time2", parseInt(my_time2));
    storage.put("my_time3", parseInt(my_time3));
    storage.put("my_time4", parseInt(my_time4));
    storage.put("my_time5", parseInt(my_time5));
    storage.put("my_time6", parseInt(my_time6));
    storage.put("my_time7", parseInt(my_time7));
    storage.put("tp_user", tp_user);
    storage.put("tp_pwd", tp_pwd);
    storage.put("softid", softid);

    var path = '美拍私信.js'
    execution = engines.execScriptFile(path);
});
